﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="~/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="~/layuiadmin/style/admin.css" media="all">
    <style type="text/css">
        .layui-table-cell {
            height: inherit;
        }
    </style>
</head>
<body>
    <div class="layui-card layadmin-header">
        <div class="layui-breadcrumb" lay-filter="breadcrumb">
            <a lay-href="">主页</a>
            <a><cite>管理员</cite></a>
            <a><cite>管理员登录</cite></a>
        </div>
    </div>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <!---搜索条件 begin--->
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button class="layui-btn layuiadmin-btn-admin" lay-submit="" lay-filter="app-search">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>                             
                            </div>
                        </div>
                    </div>
                    <!----搜索条件 end--->
                    <div class="layui-card-body">
                        <table class="layui-hide" id="app-table" lay-filter="app-table"></table>                       
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="~/layuiadmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table'], function () {
            var $ = layui.$,
                form = layui.form,
                table = layui.table;

            table.render({
                elem: '#app-table',
                url: '/Manager/LoginList',
                response: {
                    statusName: 'code', //规定数据状态的字段名称，默认：code
                    statusCode: '1000 ', //规定成功的状态码，默认：0
                    msgName: 'msg', //规定状态信息的字段名称，默认：msg
                    countName: 'count', //规定数据总数的字段名称，默认：count
                    dataName: 'data' //规定数据列表的字段名称，默认：data
                },
                cols: [[
                    { field: 'id', width: 80, title: 'ID' },
                    { field: 'userName', width: 200, title: '用户名' },
                    { field: 'client', title: '客户端' },
                    { field: 'loginIp', width: 300,title: '登录IP' },
                    { field: 'loginDate', width: 180, title: '登录时间' },
                    
                ]],
                request: {
                    pageName: 'pageIndex', //页码的参数名称，默认：page
                    limitName: 'pageSize' //每页数据量的参数名，默认：limit
                },
                page: true
            });

           
            //监听搜索
            form.on('submit(app-search)', function (data) {
                var field = data.field;

                //执行重载
                table.reload('app-table', {
                    where: field
                });
            });


        });
    </script>
</body>
</html>